<?php

namespace Modules\Car\Entities;

use App\Models\Car;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Illegal extends Model
{
    use HasFactory;

    protected $guarded = [];

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }
    //car_series_id 车系
    //gear_car_id 车辆
//    车系
    public function car(){
        return $this->hasOne(Car::class,'id','car_series_id');
    }
    //车辆
    public function gear(){
        return $this->hasOne(RecognizeDrivingLicense::class,'id','gear_car_id');
    }
    public function order(){
        return $this->hasOne(CarOrder::class,'order_sn','order_sn');
    }
}
